﻿<!DOCTYPE HTML>
<html>
{include file="public:header_css"}
<body>
<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 投票管理 <span class="c-gray en">&gt;</span> 投票选手
	<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="page-container">
	<div class="cl pd-5 bg-1 bk-gray mt-20">
		<span class="l">
            <a class="btn btn-primary radius" href="javascript:">
				<i class="Hui-iconfont"></i> 选手列表
			</a>
		</span>
		<span class="r">共有：<strong>{$total}</strong> 个选手</span>
	</div>
	<form class="form-inline" role="form" method="get">
		<div id="" class="" style="float: right;margin-top: 20px;margin-bottom: 20px;">
			<label>姓名查找:
				<input type="search" class="input-text " value="{$name ? $name : '';}" style="width: 200px;" name="keywords" id="keywords" >
				<button class="btn btn-primary radius" type="submit" id="submit"  style="margin-top: -4px;">&nbsp;&nbsp;搜索&nbsp;&nbsp;</button>
				<button class="btn btn-warning radius" type="submit" id="reset"  style="margin-top: -4px;">&nbsp;&nbsp;置空&nbsp;&nbsp;</button>
			</label>
		</div>
	</form>
	<form class="form-inline" role="form" method="get">
		<div id="" class="" style="float: left;margin-top: 20px;margin-bottom: 20px;">
			<label>活动查找:
				<select style="width:40%;" class="input-text" id="keywords1" name="keywords1">
					<option value="0"  style="width:100%;">请点击选择</option>
					{foreach name="vote_act" item="val" key="key"}
					<option value="{$val['id']}"  style="width:100%;" {if $keywords1==$val.id} selected {/if}>{$val['title']}</option>
					{/foreach}
				</select>

				<button class="btn btn-primary radius" type="submit" id="submit1" style="margin-top: -5px;">&nbsp;&nbsp;搜索&nbsp;&nbsp;</button>
				<button class="btn btn-warning radius" type="submit" id="reset1"  style="float: right;margin-left: 30px;margin-top: -32px;">&nbsp;&nbsp;重置&nbsp;&nbsp;</button>
			</label>
		</div>
	</form>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-sort">
			<thead>
			<tr class="text-c">
				<th width="80">选手编号</th>
				<th width="100">姓名</th>
				<th width="80">票数</th>
				<th width="100">图片</th>
				<th width="60">状态</th>
				<th width="100">报名时间</th>
				<th width="90">联系电话</th>
				<th width="90">投票活动</th>
				<th width="90">是否审核</th>
				<th width="150">操作</th>
			</tr>
			</thead>
			<tbody id="shopList">
			{foreach name="list" item="val" key="key"}
			<tr class="text-c">
				<td>{$val['id']}</td>
				<td>{$val['name']}</td>
				<td>{$val['vote_num']}</td>
				<td id="big">
					{foreach name="val.pic_url" item="v" key="k"}
					<img width="80" class="picture-thumb" src="{$v}" id="{$k}">
					{/foreach}
				</td>
				<td>
					{if $val['status'] == 0}正常
					{else /}退赛
					{/if}
				</td>
				<td>{$val['create_time']|date='Y-m-d',###}</td>
				<td>{$val['tel']}</td>
				<td>{$val['title']}</td>
				<td class="td-status">
					{if $val.check == 1}
					<span class="label label-success radius" onClick="is_show('{$val.id}',2)" href="javascript:;">已审核</span>
					{elseif $val.check == 0}
					<span class="label label-danger radius" onClick="is_show('{$val.id}',1)" href="javascript:;">未审核</span>
					{else}
					<span class="label label-danger radius" onClick="is_show('{$val.id}',1)" href="javascript:;">已拒绝</span>
					{/if}
				</td>
				<td class="f-14 product-brand-manage" id="use">
					<a class="label label-secondary radius" href="{:url('vote_recode',array('id'=>$val['id']))}">投票记录</a>
					<a class="label label-secondary radius"  onClick="del('{$val.id}')">删除</a>
				</td>
			</tr>
			{/foreach}
			{if count($list)<=0 }
			<tr class="text-c">
				<td colspan="11">
					暂无数据
				</td>
			</tr>
			{/if}
			</tbody>
		</table>
	</div>
	{$page}
</div>

{include file="public:footer_js"}

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__STATIC__/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="__STATIC__/admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="__STATIC__/admin/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="__STATIC__/admin/lib/laypage/1.2/laypage.js"></script>

<script type="text/javascript">

	//审核
    function is_show(id,check){
        var notice = "确认拒绝通过吗？";
        if(check === 1){
            notice = "确认通过审核吗？";
        }
        layer.confirm(notice,function (index) {
            $.post(
                '{:url("status")}?id='+id,
                {
                    check:check
                },
                function (res) {
                    if(res.code === 1){
                        layer.msg(res.msg,{icon:6,time:1000});

                        setTimeout(function () {
                            location.replace(location.href);
                        },2000);
                    }else{
                        layer.msg(res.msg,{icon:5,time:1000});
                    }
                }
            );
        });

    }

    //姓名重置
    $('#reset').click(function () {
        $('#keywords').val('');
    })

	//活动重置
    $('#reset1').click(function () {
        $('#keywords1').val('');
    })
    //软删除
    function del(id)
    {
        var notice = "确认删除吗？";
        layer.confirm(notice,function () {
            $.post(
                '{:url("del")}',
                {
                    status: 1,
                    id : id
                },
                function (res) {
                    if(res.code === 1){
                        layer.msg("删除成功",{icon:6,time:1000});
                        setTimeout(function () {
                            location.replace(location.href);
                        },2000);

                    }else{
                        layer.msg(res.msg,{icon:5,time:1000});
                    }
                }
            );
        });
    }

    //图片放大
    $(function(){
        var wwValue;
        var hhValue;
        $('#big img').mouseenter(function(){
            wwValue=$(this).width();
            hhValue=$(this).height();
            var wValue=2.2 * $(this).width();
            var hValue=2.2 * $(this).height();
            $(this).stop().animate(
                {width: wValue,
                height: hValue,
                }, 1000);
        }).mouseleave(function(){
            $(this).stop().animate(
                {width: wwValue,
                height: hhValue,
                }, 1000 );
        });
    });
</script>
</body>
</html>